<extend name="Index::index"/>
<block name="table">
	<h1>广告管理</h1>
	<a href="{:U('Addver/add')}"><button style="width:100px;height:40px;border:none;background:#DC5448;">添加广告</button></a>
	<table class="table"  border="1" cellspacing="0" cellpadding="5" align="center">
		<tr bgcolor="#ccc">
			<th>编号</th>
			<th>广告</th>
			<th>状态</th>
			<th>广告位</th>
			<th>操作</th>
		</tr>
		<foreach name="list" item="val">
			<tr>
				<td>{$val['id']}</td>
				<td><img src="__ROOT__{$val['name']}" alt=""></td>
				<td>
					<if condition="$val['status'] eq 1">
							<a style="color:red" href="{:U('Status',['id'=>$val['id'],'status'=>$val['status']])}">
							 上架</a>
						<else /> 
							 <a style="color:blue" href="{:U('Status',['id'=>$val['id'],'status'=>$val['status']])}">下架</a>
					</if>
				</td>
				<td>{$val['address']}</td>
				<td><a href="{:U('deleted',['id'=>$val['id']])}">删除</a></td>
			</tr>
		</foreach>
	</table>

</block>
